import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/apis/layout'
export const useCategoryStores=defineStore("category",()=>{
    //定义变量
    const categories= ref([]);
    //定义函数
    const getCategory= async ()=>{
        const res= await getCategoryAPI();
        categories.value= res.result;
    }
    return {
        categories,
        getCategory
    }
})